<template>
  <div class="video">
    <van-nav-bar title="视频" />
    <div class="main" v-for="item in videoData" :key="item.id">
      <p>{{ item.titel }}</p>
      <div class="main_video">
        <video :src="item.videoSrc" controls></video>
      </div>
      <div class="desc">
        <div>
          <span>{{ item.playNum }}</span
          >次播放
        </div>
        <div>
          <span>{{ item.readNum }}</span
          >次阅读
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'video',
  data () {
    return {
      videoData: [
        {
          id: 1,
          titel: '端午佳节｜“加点绝云椒椒的话…”',
          videoSrc:
            'https://webstatic.mihoyo.com/upload/static-resource/2022/05/20/8191caae4effb381d69cdb9bd15c14e8_6680465099310867676.mp4',
          playNum: 1502,
          readNum: '999+'
        },
        {
          id: 2,
          titel: '【塞尔达传说】CG过场动画 已追加DLC内容',
          videoSrc: 'https://www.bilibili.com/video/BV1zt411w7B7?t=45.8',
          playNum: 2002,
          readNum: 824
        }
      ]
    }
  }
}
</script>

<style lang="less" scoped>
.van-nav-bar {
  position: fixed;
  width: 100%;
  top: 0;
  left: 0;
}
.main {
  padding: 50px 30px 30px 30px;
  border-radius: 8px;

  &:nth-of-type(n + 3) {
    border-top: 1px solid #f1f1f1;
    padding-top: 30px;
  }
  > p {
    font-size: 18px;
  }
  .main_video {
    margin: 8px 0;
    width: 100%;
    // height: 466px;
    background-color: #eee;
    border-radius: 8px;
    > video {
      width: 100%;
      height: 100%;
    }
  }
  .desc {
    display: flex;
    justify-content: space-between;
    padding-right: 5px;
    color: #999;
  }
}
</style>
